<!--
 * @Author: xuzehan 123@qq.com
 * @Date: 2023-04-09 11:51:07
 * @LastEditors: xuzehan 123@qq.com
 * @LastEditTime: 2023-04-09 12:13:31
 * @FilePath: \ant-design-vue-jeecg-master\src\views\baseStationChannel\modules\baseStationModal.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    switchFullscreen
    @ok="handleOk"
    :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }"
    @cancel="handleCancel"
    cancelText="关闭"
  >
    <base-station-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></base-station-form>
  </j-modal>
</template>

<script>
import baseStationForm from './baseStationForm'
export default {
  name: 'baseStationModal',
  components: {
    baseStationForm,
  },
  data() {
    return {
      title: '',
      width: 800,
      visible: false,
      disableSubmit: false,
    }
  },
  methods: {
    add() {
      this.visible = true
      this.$nextTick(() => {
        this.$refs.realForm.add()
      })
    },
    edit(record) {
      this.visible = true
      this.$nextTick(() => {
        this.$refs.realForm.edit(record)
      })
    },
    close() {
      this.$emit('close')
      this.visible = false
    },
    handleOk() {
      this.$refs.realForm.submitForm()
    },
    submitCallback() {
      this.$emit('ok')
      this.visible = false
    },
    handleCancel() {
      this.close()
    },
  },
}
</script>
